/**
 * @param {string[]} operations
 * @return {number}
 */
 var finalValueAfterOperations = function(operations) {
  let ans = 0
  for(const s of operations){
    if(s === '--X' || s === 'X--'){
      ans--
    }else{
      ans++
    }
  }
  return ans
};